//
//  ZCOrderCheckAutoCell.m
//  ZCJZ
//
//  Created by sujeking on 2019/4/2.
//  Copyright © 2019年 jeking. All rights reserved.
//

#import "ZCOrderCheckAutoCell.h"
#import "TBCityIconFont.h"
#import <BlocksKit+UIKit.h>
@interface ZCOrderCheckAutoCell()<UITextViewDelegate>

@property (weak, nonatomic) IBOutlet UITextView *inTV;
@property (weak, nonatomic) IBOutlet UIView *btnView;
@property (weak, nonatomic) IBOutlet UIImageView *iconimv;


@end


@implementation ZCOrderCheckAutoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupSubViews];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setupSubViews {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.inTV.text = nil;
    self.btnView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap  = [UITapGestureRecognizer bk_recognizerWithHandler:^(UIGestureRecognizer *sender, UIGestureRecognizerState state, CGPoint location) {
        if (self.endInputCallback) {
            [self.inTV resignFirstResponder];
            self.endInputCallback(self.inTV.text);
        }
    }];
    [self.btnView addGestureRecognizer:tap];
    
    UIImage *img = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e671;", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0xC20114"])];
    self.iconimv.image = img;

    UILabel *placeHolderLabel = [[UILabel alloc] init];
    placeHolderLabel.text = @"例如:\"张三 123456789 四川省成都市锦江区春熙路\"";
    placeHolderLabel.numberOfLines = 0;
    placeHolderLabel.textColor = [UIColor lightGrayColor];
    [placeHolderLabel sizeToFit];
    [self.inTV addSubview:placeHolderLabel];
    placeHolderLabel.font = self.inTV.font;
    [self.inTV setValue:placeHolderLabel forKey:@"_placeholderLabel"];
}

@end
